package com.entities.reportcolumn.requestmapparser;

import com.core.utils.RequestParams;
import com.model.report.ReportColumn;


public class ReportColumnMapParser {

	public static ReportColumn fromMap ( RequestParams requestParams ) {

		if ( requestParams == null ) {
			return null;
		}


		String name = requestParams.stringAtIndexForKey(0, "name");

		String description = requestParams.stringAtIndexForKey(0, "description");

		String entityColumnName = requestParams.stringAtIndexForKey(0, "entityColumnName");

		String entityAlias = requestParams.stringAtIndexForKey(0, "entityAlias");

		String joins = requestParams.stringAtIndexForKey(0, "joins");

		String entityClassName = requestParams.stringAtIndexForKey(0, "entityClassName");

		ReportColumn template = null;
		template = new ReportColumn();
		template.setName(name);
		template.setEntityClassName(entityClassName);
		template.setEntityAlias(entityAlias);
		template.setJoins(joins);
		template.setDescription(description);
		template.setEntityColumnName(entityColumnName);

		return template;

	}

}
